Skip to content

Exclude repository-configuration from git-archive #1343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2022

Conversation

umlaeute
Copy link
Contributor

@umlaeute umlaeute commented Jul 7, 2022

tracking repository configuration (like .gitignore) and CI-configuration (.github/, .travis.yml) within a repository is nice, practical and sometimes unavoidable.

however, such configs do not place nicely when downstreams import the archives into their own git-based workflows.

e.g. for the Debian packaging of python-can, we definitely do not want to hide any build-artifacts via .gitignore (our workflow is very different from that of upstream development).
we also do not want to accidentally trigger our CI (our CI is supposed to test the packaging, rather than the development).
otoh, we also want to follow the upstream sources as close as possible (that is: without adding/changing/removing any files from the upstream releases).

the typical fix for this is to simply not include the repository-configuration when exporting a snapshot, such as is created automatically by github when downloading a "Release Tarball" (which is really just running git archive in the background).

the .gitattributes file in this PR does exactly this: it excludes a number of repository- and CI-configuration files from git archive.

@codecov
Copy link

codecov bot commented Jul 7, 2022

Codecov Report

Merging #1343 (e27993b) into develop (5bca2d7) will increase coverage by 0.04%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #1343      +/-   ##
===========================================
+ Coverage    66.01%   66.06%   +0.04%     
===========================================
  Files           86       86              
  Lines         8960     8960              
===========================================
+ Hits          5915     5919       +4     
+ Misses        3045     3041       -4     

@zariiii9003
Copy link
Collaborator

I'm not sure i understand your use case. Debian packaging clones the python-can github repo? Why wouldn't they use the source distribution on PyPI?

@umlaeute
Copy link
Contributor Author

We use the source tarballs from github (not a clone of GH repository).

iirc, the reason being that the we want to run all the checks (as found in the upstream development, but often stripped from pypi packages) but avoid binary artifacts (often found in pypi packages).

this is a generic answer (I'm currently afk and cannot check the specific reason for python-can)

otoh: do you have a specific usecase why you want to include .gitignore and .github/ in the release tarballs?

@zariiii9003 zariiii9003 merged commit f59fe4f into hardbyte:develop Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants